package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.pojo.CarModel;
import com.zhentao.service.CarModelService;
import com.zhentao.mapper.CarModelMapper;
import com.zhentao.vo.CarModelVO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @description 车型管理Service实现类
*/
@Service
public class CarModelServiceImpl extends ServiceImpl<CarModelMapper, CarModel>
    implements CarModelService {

    @Resource
    private CarModelMapper carModelMapper;
    
    @Override
    public CarModelVO getModelWithBrand(Long id) {
        return carModelMapper.getModelWithBrand(id);
    }
    
    @Override
    public IPage<CarModelVO> pageModelWithBrand(Page<CarModel> page) {
        return carModelMapper.pageModelWithBrand(page);
    }
    
    @Override
    public List<CarModelVO> listModelsByBrandId(Long brandId) {
        return carModelMapper.listModelsByBrandId(brandId);
    }
}
